project(RV1126_3A)
cmake_minimum_required(VERSION 3.8)
message(STATUS "cmake version ${CMAKE_VERSION}")

set(TOOLCHAIN_DIR /opt/atk-dlrv1126-toolchain)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/usr/bin/arm-linux-gnueabihf-g++)
set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/usr/bin/arm-linux-gnueabihf-gcc)
set(SYSROOT ${TOOLCHAIN_DIR}/arm-buildroot-linux-gnueabihf/sysroot/usr/include)
set(CMAKE_SYSROOT ${TOOLCHAIN_DIR}/arm-buildroot-linux-gnueabihf/sysroot)


set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
add_definitions(-g -O0 -ggdb -gdwarf -funwind-tables -rdynamic -fpermissive)
add_definitions(-Wno-write-strings -Wno-return-type)

set(RKMEDIA_LIBS easymedia rkaiq sample_common_isp)
set(THIRD_MEDIA third_media)

include_directories(${SYSROOT})
include_directories(${SYSROOT}/easymedia)
include_directories(${SYSROOT}/rkaiq/uAPI)
include_directories(${SYSROOT}/rkaiq/xcore)
include_directories(${SYSROOT}/rkaiq/algos)
include_directories(${SYSROOT}/rkaiq/common)
include_directories(${SYSROOT}/rkaiq/iq_parser)

add_definitions(-DRKAIQ)

set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/../abseil-cpp)
find_package(absl REQUIRED)
find_package(ALSA REQUIRED)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../webrtc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../abseil-cpp/include)

add_executable(alsa_list_ao alsa_list_ao.cpp)
target_link_libraries(alsa_list_ao ${ALSA_LIBRARY})

add_executable(test3A test3A.cpp)
target_link_libraries(test3A 
${ALSA_LIBRARY} 
absl::optional absl::throw_delegate absl::strings absl::strings_internal    
/home/shun/work/project/WebrtcAudioProcessing/build/webrtc/libwebrtc_audio_processing.so   
pthread)

add_executable(rkmedia_ai_aenc_3a rkmedia_ai_aenc_3a.cpp)
target_link_libraries(rkmedia_ai_aenc_3a 
absl::optional absl::throw_delegate absl::strings absl::strings_internal    
/home/shun/work/project/WebrtcAudioProcessing/build/webrtc/libwebrtc_audio_processing.so   
${THIRD_MEDIA} 
${RKMEDIA_LIBS} 
pthread)


